package zhai.docking.alipay.domain.base.bizlog;

import lombok.Data;

/**
 * @author Created by 翟凤玺
 * @package zhai.docking.alipay.domain.base.bizlog
 * @project-name zhai-docking-alipay
 * @description 业务日志持久化
 * @create-datetime 2020-1-19 11:12
 */
@Data
public class BizLogSave {

    /**
     * mongodb数据库
     */
    public static final String DB_TYPE_MONGODB = "mongodb";
    /**
     * 保存方式：异步
     */
    public static final String SAVE_TYPE_ASYNC = "async";

    /**
     * 数据库类型
     */
    private String dbType = DB_TYPE_MONGODB;

    /**
     * 持久化方式
     */
    private String saveType = SAVE_TYPE_ASYNC;

    /**
     * 表名称
     */
    private String dbName;

    /**
     * 唯一标识
     */
    private String id;
    /**
     * 业务日志信息
     */
    private Object data;

    public BizLogSave(Object data, String dbName) {
        this.data = data;
        this.dbName = dbName;
    }

    public BizLogSave(String id, Object data, String dbName) {
        this.id = id;
        this.data = data;
        this.dbName = dbName;
    }

    public BizLogSave(String id, Object data, String dbName, String dbType, String saveType) {
        this.id = id;
        this.data = data;
        this.dbName = dbName;
        this.dbType = dbType;
        this.saveType = saveType;
    }
}